package com.sian.anyun.web.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller("LoginController")
@RequestMapping("/")
public class LoginController
{
	@RequestMapping(value = "/login", method = RequestMethod.GET)
	public String login(@RequestParam(value="error", required=false) boolean error, ModelMap model) 
	{
		if (error == true) 
		{
			model.put("error", "You have entered an invalid username or password!");
		}
		else
		{
			model.put("error", "");
		}
		
		return "/pub/login";
 	}
}
